package com.qhhc.service.impl;

import com.qhhc.entity.Employee;
import com.qhhc.mapper.EmployeeMapper;
import com.qhhc.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeService implements IEmployeeService {
    @Autowired
    EmployeeMapper employeeMapper;

    @Override
    public List<Employee> getAllEmployees() {
        return employeeMapper.selectAllEmployees();
    }

    @Override
    public void insertEmployee(Employee employee) {
        employeeMapper.insertEmployee(employee);

    }

    @Override
    public void deleteEmployee(Long empId) {
        employeeMapper.deleteEmployeeById(empId);

    }

    @Override
    public void updateEmployee(Employee employee) {
        employeeMapper.updateEmployee(employee);

    }

    @Override
    public Employee getEmployeeById(long employeeId) {
        Employee employee = employeeMapper.selectEmployeeById(employeeId);
        return employee;
    }
}
